<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="com.c0nflict.server.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="admin_header.jspf" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>c0nflict: Table Manager - Watchers</title>
</head>
<body>

<center><h3 style="color: #ccc;"><b><%= tm.WATCHDOG.toString() %></b></h3></center>

<center><font size="5" color="white" face="verdana"><a name="watchers"><b>Watchers</b></a></font></center>

<div class="watchersContainer">
<table class="sortable" cellpadding="4" cellspacing="0">
<thead>
<tr>
	<th width="100px">Name</th>
	<th width="60px">IP</th>
	<th width="60px">Table</th>
	<th width="120px">Referer</th>
</tr>
</thead>
<tfoot>
<tr><td colspan="0">Watchers in memory as of <%= tm.WATCHDOG.toString() %></td></tr>
</tfoot>
<tbody>
	<% int i = 1;
	Table tbl = null;
	
	for (Player p : tm.userSessions.keySet()) {
		if (!p.isAutomaton() && p.isBlocked()) {
			tbl = tm.getTable(p);
	%>
<tr <% if (i++ % 2 == 0) { %> bgcolor="#222" <% } 
  String ref = null;
  try {
  if (p.getHttpSession()!=null) ref=(String)p.getHttpSession().getAttribute("DQOR");
  } catch (Exception e) {}
%> >
	<td><%= p.getName() %></td>
	<td><%= p.getIPAddr() %></td>
	<td><% if (tbl != null) { tbl.getName(); } %></td>
	<td><%= ref %></td>
</tr>
	<%	}
	} %>
</tbody>
</table>
</div>
<%@ include file="admin_footer.jspf" %>
</body>
</html>
